package com.jiuxian.scheduling.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;

/**
 * Created by wangjingqing on 2017/11/8.
 */
public class ConfigUtil {
    static Logger logger = LoggerFactory.getLogger(ConfigUtil.class);
    static ResourceBundle config;
    static{
        try {
            config = PropertyResourceBundle.getBundle("config");
        } catch (Exception e) {
            logger.error("加载config失败：",e);
        }

    }

    /**
     * 根据key获取value<br>
     * @param name config中的key
     * @return value
     */
    public static String getValue(String name){
        return config.getString(name);
    }
}
